#pragma once

#include <drogon/HttpController.h>

using namespace drogon;

class FileController : public drogon::HttpController<FileController> {
  public:
    METHOD_LIST_BEGIN
    ADD_METHOD_TO(FileController::getFile,
                  "/file/{1:fileName}",
                  Get);
    ADD_METHOD_TO(FileController::uploadFile,
                  "/file/{1:fileName}?id={2:id}&token={3:token}",
                  Post);

    METHOD_LIST_END
    void uploadFile(const HttpRequestPtr&                         req,
                    std::function<void(const HttpResponsePtr&)>&& callback,
                    std::string                                   fileName,
                    int                                           id,
                    std::string                                   token) const;
    void getFile(const HttpRequestPtr&                         req,
                 std::function<void(const HttpResponsePtr&)>&& callback,
                 std::string                                   fileName) const;
};
